<?php

namespace app\api\controller;

use app\common\controller\Api;
use think\Db;

/**
 * 首页接口
 */
class Index extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * 首页
     *
     */
    public function index()
    {
        $this->success('请求成功');
    }

    public function getPhone()
    {
        $list = Db::name('phone')->where(['status' => 0])->order('id', 'asc')->limit(20)->column('phone');
        $this->success('请求成功', $list);
    }

    public function recordPhone($phone, $status)
    {
        Db::name('phone')->where(['phone' => $phone])->update([
            'status' => $status,
            'record_time' => time()
        ]);
        $this->success('请求成功');
    }
}
